﻿@{
    ViewBag.Title = "FeedBack Commnet";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    List<SelectListItem> lstNam = new List<SelectListItem>();
    lstNam.Add(new SelectListItem
    {
        Value = "-1",
        Text = "-- Chọn năm --"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2012",
        Text = "2012"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2013",
        Text = "2013"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2014",
        Text = "2014"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2015",
        Text = "2015"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2016",
        Text = "2016"
    });
    lstNam.Add(new SelectListItem
    {
        Value = "2017",
        Text = "2017"
    });


    List<SelectListItem> lstDaotao = new List<SelectListItem>();
    lstDaotao.Add(new SelectListItem
    {
        Value = "-1",
        Text = "-- Chọn nhóm chỉ tiêu --"
    });
    lstDaotao.Add(new SelectListItem
    {
        Value = "0",
        Text = "Đào tạo"
    });
    lstDaotao.Add(new SelectListItem
    {
        Value = "1",
        Text = "Nghiên cứu khoa học"
    });
    lstDaotao.Add(new SelectListItem
    {
        Value = "2",
        Text = "Tuyển sinh"
    });
    lstDaotao.Add(new SelectListItem
    {
        Value = "3",
        Text = "Hội nhập quốc tế"
    });
    lstDaotao.Add(new SelectListItem
    {
        Value = "4",
        Text = "Tổ chức các bộ"
    });
    lstDaotao.Add(new SelectListItem
    {
        Value = "5",
        Text = "Thanh tra pháp chế"
    });

}
<link href="~/Content/standard_form_nhaplieu.css" rel="stylesheet" />
<link href="@Url.Content("~/Content/jquery-ui.1.10.2.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.maskedinput.js")"></script>
<script>
    function datePicker() {
        var option = {
            //dayNamesMin: ["CN", "Thứ 2", "Thứ 3", "Thứ 4", "Thứ 5", "Thứ 6", "Thứ 7"],
            dayNamesMin: ["CN", "2", "T3", "T4", "T5", "T6", "T7"],
            monthNames: ["Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5",
                "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"],
            dateFormat: "dd/mm/yy",
            onSelect: function (selectedDate) {
                //alert(selectedDate);

            }
        };

        $("#Hanbaocao").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });
        $("#Hanbaocao").datepicker(option);
    }
    function isNumeric(n) {
        return !isNaN(parseFloat(n)) && isFinite(n);
    }
    $(document).ready(function () {
        datePicker();
        $('.restartall').blur(function () {
            if ($(this).val() != "") {
                if (!isNumeric($(this).val())) {
                    alert('Bạn vui lòng nhập kiểu số !');
                    $(this).val('');
                }
            }
        });
        $(".restartall").each(function () {
            var b = $(this).attr('name');
            calculateSum(b);
            $(this).keyup(function () {
                var a = $(this).attr('name');
                calculateSum(a);
            });
        });
    })
    function calculateSum(a) {
        var sum = 0;
        //iterate through each textboxes and add the values
        $(".restartall").each(function () {
            if ($(this).attr('name') == a) {
                //add only if the value is number
                if (!isNaN(this.value) && this.value.length != 0) {
                    sum += parseFloat(this.value);
                }
            }

        });
        //.toFixed() method will roundoff the final sum to 2 decimal places
        $('.' + a + '').val(sum);
    }
</script>
<style>
    tbdata {
        table-layout: fixed;
        word-wrap: break-word;
        font-size: small;
    }

    .ct1 {
        text-align: center;
    }

    #parent {
        max-height: 400px;
    }

    .e-input3 {
        background-color: #F7CECE;
        border: 1px solid #ddd;
        text-align: left;
        border-radius: 3px;
        padding: 5px;
        height: 34px;
        font-family: "Open Sans", arial !important;
        box-shadow: 0 1px 1px rgba(50,50,50,0.1);
    }

    .e-input1 {
        background-color: #ddd;
        border: 1px solid #ddd;
        text-align: left;
        border-radius: 3px;
        padding: 5px;
        height: 34px;
        font-family: "Open Sans", arial !important;
        box-shadow: 0 1px 1px rgba(50,50,50,0.1);
    }

    .e-input2 {
        border: 1px solid #ddd;
        background: #bee6ff;
        text-align: left;
        border-radius: 3px;
        padding: 5px;
        height: 34px;
        font-family: "Open Sans", arial !important;
        box-shadow: 0 1px 1px rgba(50,50,50,0.1);
    }

    .commnetban {
        height: 34px;
    }

    .restartall {
        width: 113%;
        margin-left: -6%;
    }

    th {
        text-align: center;
    }

    .rejectnew {
        margin-left: -6% !important;
        margin-top: 8% !important;
        height: 29px !important;
        padding-left: 0px;
        width: 112% !important;
    }

    .popover {
        width: 300px;
        height: 250px;
    }
</style>
<div class="page-bar">
    <ul class="page-breadcrumb" style="padding: 4px;">
        <li>
            <i class="fa fa-home"></i>
            <a href="#">@ViewBag.CurrentMenuName</a>
        </li>
    </ul>
</div>
<div class="row margin-bottom-20">
    <div class="col-md-5">
        <div class="row" style="margin-top:5px;">
            @Html.Label("Năm kế hoạch", new { @class = "col-md-5", id = "lb1" })
            <div class="col-md-7">
                @Html.DropDownList("Namlapbc", lstNam, new { id = "Namlapbc", style = "margin:0px;", @class = "form-control input-sm" })
            </div>
        </div>

    </div>

    <div class="col-md-7">
        <button type="button" class="btn btn-sm btn-primary" id="CreateNew" style=" margin-top: 5px; cursor:pointer;"><i class="fa fa-list"></i> Duyệt kế hoạch thực hiện</button>
        <button type="button" class="btn btn-sm btn-danger" id="HuyChot" style=" margin-top: 5px; cursor:pointer; display:none;" ><i class="fa fa-reply"></i> Hủy gửi Ban KHTC</button>
        <button type="button" class="btn btn-sm btn-primary" id="Create" style=" margin-top: 5px; cursor:pointer;"><i class="fa fa-reply"></i> Phản hồi ý kiến của đơn vị</button>
    </div>
</div>

<div class="row" id="tblds" style="display:none;">
    <label id="thongbao" style="margin-left: 1.5%;color: red;"></label>
    <table id="dsdv" class="table table-striped table-bordered table-hover dataTable no-footer" style="width: 82%; margin-left: 1.5%;">
        <thead>
            <tr class="header">
                <th scope="col" style="width:10%">
                    STT
                </th>
                <th scope="col">
                    Tên đơn vị chưa nộp báo cáo
                </th>
            </tr>
        </thead>
        <tbody id="dsbody"></tbody>
    </table>
</div>

<div id="gridContent" align="center">
    <table class="table table-striped table-bordered table-hover dataTable no-footer" style="width:100%;">
        <thead>
            <tr class="header">
                <th scope="col">
                    STT
                </th>
                <th scope="col" style="width:12%;">
                    Năm kế hoạch
                </th>
                <th scope="col" class="hidden-480" style="width:30%;">
                    Tên chỉ tiêu
                </th>
                <th scope="col" class="hidden-480" style="width:30%;">
                    Ý kiến
                </th>
                <th scope="col" class="hidden-480" style="width:22%;">
                    Đơn vị
                </th>
            </tr>
        </thead>
        <tbody id="body"></tbody>
    </table>
</div>


<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:70%;">

        <div class="modal-content">
            <div class="modal-header" style="color: white; background-color: #23C34C; border-color: #23C34C; ">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Phản hồi ý kiến của đơn vị</h4>
            </div>
            <div class="modal-body">

                <div class="table-responsive">
                    <table class="table table-bordered table-hover ">
                        <thead>
                            <tr>
                                <th rowspan="2" style="width:30%;"><span>Chỉ tiêu</span></th>
                                <th rowspan="2" style="width:8%;"><span>Đơn vị tính</span></th>
                                <th colspan="5" style="width:60%;"><select class="form-control" id="lstdstruong" style="width: 65%;display: -webkit-inline-box;margin-left: 3%;"></select></th>

                            </tr>
                            <tr>
                                <th style="text-align: center;">Kế hoạch ban đầu</th>
                                <th style="text-align: center;">Kế hoạch điều chỉnh</th>
                                <th style="text-align: center;">Kỳ báo cáo này</th>
                                <th style="text-align: center;">Ý kiến</th>
                                <th style="text-align: center;">Thao tác</th>
                            </tr>
                        </thead>
                        <tbody id="bd"></tbody>
                    </table>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" id="Phanhoi" class="btn btn-primary">Gửi phản hồi cho đơn vị</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">Đóng</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="myModalHistoryComment" tabindex="-1" style="z-index:11000" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog ">

        <div class="modal-content">
            <div class="modal-header" style="color: white; background-color: #23C34C; border-color: #23C34C; ">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Phản hồi ý kiến của đơn vị</h4>
            </div>
            <div class="modal-body">
                <div id="chatbox">
                    <div class="blue_box">
                        <span>Hello</span>
                    </div>
                    <div class="green_box">
                        <span>Bye</span>
                    </div>

                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Đóng</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="myModalNew" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width:100%;">
        <div class="modal-content">
            <div class="modal-header" style="color: white; background-color: #23C34C; border-color: #23C34C; ">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">Duyệt kế hoạch thực hiện cho đơn vị</h4>
            </div>
            <div class="modal-body">
                <div>
                    <div class="row">
                        <div class="col-md-8">
                            <form role="form">
                                <div class="col-md-6">
                                    <label class="radio-inline">
                                        <input type="radio" name="inlineRadioOptions" id="dvn" value="dv"> Chọn đơn vị:
                                        <select disabled="disabled" class="form-control" id="donvi"></select>
                                    </label>
                                </div>
                                <div class="col-md-6">
                                    <label class="radio-inline chn">
                                        <input type="radio" name="inlineRadioOptions" value="nhom" checked="checked"> Chọn nhóm: <select class="form-control" id="nhomdonvi"></select>
                                    </label>
                                </div>
                            </form>
                        </div>
                        <div class="col-md-4">
                            <div class="col-md-8">
                                <label>
                                    Chọn nhóm chỉ tiêu
                                </label>
                                <select class="form-control" id="nhomchitieu"></select>
                            </div>
                        </div>
                    </div>
                    <br />
                    <br />
                    <div style="">
                        <div style="" id="parent">
                            <table class="table table-bordered table-hover" id="tbdata" style="table-layout: fixed; word-wrap: break-word; font-size: small; max-height:600px; overflow:auto;">
                                <thead id="hhh">

                                </thead>
                                <tbody id="bdy"></tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                @*<button type="button" data-dismiss="modal" class="btn btn-primary">Export</button>*@
                <button type="button" id="Chot" class="btn btn-primary">Duyệt và gửi Ban KHTC</button>
                <button type="button" id="SendComment" class="btn btn-primary">Gửi phản hồi cho đơn vị</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">Đóng</button>
            </div>
        </div>
    </div>
</div>
<script>
    @functions{
        public string GetAntiForgeryToken()
        {
            string cookieToken, formToken;
            AntiForgery.GetTokens(null, out cookieToken, out formToken);
            return cookieToken + "," + formToken;
        }
       }
</script>
<script src="@Url.Content("~/Scripts/DHQG/FeedBackComment.js?v=20160701")" type="text/javascript"></script>
<script>
    $(function () {
        var initData = {
            VerificationToken: "@GetAntiForgeryToken()",
            GetallNamkehoach: "@Url.Action("GetallNamkehoach", "Kehoachnam")",
            GetallCommentByDv: "@Url.Action("GetallCommentByDv", "Kehoachnam")",
            DonviID: '@ViewBag.DonviID',
            TenDV: '@ViewBag.TenDV',
            QUYENGIAMSAT: '@ViewBag.QUYENGIAMSAT',
            UpdateCommentbyBan: '@Url.Action("UpdateCommentbyBan", "Kehoachnam")',
            UpdateCommentApprove: '@Url.Action("UpdateCommentApprove", "Kehoachnam")',
            GetallChitieu: "@Url.Action("GetallChitieu","Kehoachnam")",
            GetallChitieubynamchitieu: "@ViewBag.URL",
            GetDonViByNhom: "@Url.Action("GetDonViByNhom", "Kehoachnam")",
            GetKehoachbyNamkehoach: "@Url.Action("GetKehoachbyNamkehoach", "Kehoachnam")",
            Getallnhomdonvi: "@Url.Action("Getallnhomdonvi", "Kehoachnam")",
            Getallstatus: "@Url.Action("Getallstatus", "Kehoachnam")",
            GetAllDonViByNhomID: "@Url.Action("GetAllDonViByNhomID", "Kehoachnam")",
            Getallchitieubymacap2: "@Url.Action("Getallchitieubymacap2", "Kehoachnam")",
            GetNamkehoachbyID: "@Url.Action("GetNamkehoachbyID", "Kehoachnam")",
            GetAllDvCtbyNKH: "@Url.Action("GetAllDvCtbyNKH", "Kehoachnam")",
            SaveDonViChiTieu: "@Url.Action("SaveDonViChiTieu", "Kehoachnam")",
            UpdateStatusid: '@Url.Action("UpdateStatusid", "Kehoachnam")',
            CheckNamChot: '@Url.Action("CheckNamChot", "Kehoachnam")',
            GetDonviChuaPhanHoi: '@Url.Action("GetDonviChuaPhanHoi", "Kehoachnam")',
            GetDonViID: '@Url.Action("GetDonViID", "Kehoachnam")',
            GetallKHTH: '@Url.Action("GetallKHTH", "Kehoachnam")',
            GetSumKH: '@Url.Action("GetSumKH", "Kehoachnam")',
            GetSumKHTH: '@Url.Action("GetSumKHTH", "Kehoachnam")',
            SaveCommnet: '@Url.Action("SaveCommnet", "Kehoachnam")',
            GetallCommentByBan: '@Url.Action("GetallCommentByBan", "Kehoachnam")',
            CommentCheckChot: '@Url.Action("CommentCheckChot", "Kehoachnam")',
            CommentChot: '@Url.Action("CommentChot", "Kehoachnam")',
            CheckFeedBack: '@Url.Action("CheckFeedBack", "Kehoachnam")',
            Getkehoachbymockiemsoat: "@Url.Action("Getkehoachbymockiemsoat", "Kehoachnam")",
            Getkehoachbymockiemsoatbefo: "@Url.Action("Getkehoachbymockiemsoatbefo", "Kehoachnam")",
            CheckCommnetchot: "@Url.Action("CheckCommnetchot", "Kehoachnam")",
            GetallHistoryComment: "@Url.Action("GetallHistoryComment", "Kehoachnam")",
            CheckChotbyMocKSByBan:"@Url.Action("CheckChotbyMocKSByBan", "Kehoachnam")",
            CommentHuychot:"@Url.Action("CommentHuychot", "Kehoachnam")",
            GetKehoachByNamKeHoach_NhomDV_NhomCT: "@Url.Action("GetKehoachByNamKeHoach_NhomDV_NhomCT", "Kehoachnam")"


        };
        FeedBackComment.init(initData);

    });


</script>
